# coding: utf-8
from sqlalchemy import Column, Integer, String
from flask_sqlalchemy import SQLAlchemy
from common.models.user import User
from application import db


class WorkList(db.Model):
    __tablename__ = 'work_list'

    id = db.Column(db.Integer, primary_key=True, info='listid')
    listdata = db.Column(db.Date)
    listtask = db.Column(db.String(20))
    listcontent = db.Column(db.String(90))
    listremark = db.Column(db.String(255))
    type = db.Column(db.String(20))
    weight = db.Column(db.Integer)
    uid = db.Column(db.Integer,db.ForeignKey('user.id'))
    classone = db.Column(db.String(40))
    classtwo = db.Column(db.String(40))
    classthree = db.Column(db.String(40))
    classfour = db.Column(db.String(40))
    classfive = db.Column(db.String(40))
    createuid = db.Column(db.Integer, db.ForeignKey('user.id'))
    updated_time = db.Column(db.DateTime)
    created_time = db.Column(db.DateTime)
    user = db.relationship('User', foreign_keys=createuid)
    creater = db.relationship('User', foreign_keys=uid)

    # def __init__(self, createuid, uid):
    #     self.createuid = createuid
    #     self.uid = uid
    #
    # def __repr__(self):
    #     return 'WorkList:%s' % self.id

    # def __repr__(self):
    #     return '<Follow[%s,%s,%s]>' % (self.user, self.follower, self.createTime)